//
//  HYNetworkTool.swift
//  iOSWeibo
//
//  Created by why on 16/7/19.
//  Copyright © 2016年 王浩宇. All rights reserved.
//
import UIKit

import AFNetworking

class HYNetworkTool: AFHTTPSessionManager {
    
    static let sharedInstance: HYNetworkTool = HYNetworkTool(baseURL: NSURL(string: "https://api.weibo.com/"))
    
    // 自己来实现构造函数
    override init(baseURL url: NSURL?, sessionConfiguration configuration: NSURLSessionConfiguration?) {
        super.init(baseURL: url, sessionConfiguration: configuration)
        
        // 添加返回序列化器支持的类型
        self.responseSerializer.acceptableContentTypes?.insert("text/plain")
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
